
const myToken = 'my_token'

// 设置token
export const setToken = (newToken) => {
    localStorage.setItem(myToken, JSON.stringify(newToken))
}

// 获取token
export const getToken = () => {
    return JSON.parse(localStorage.getItem(myToken))
}

// 删除token
export const remToken = () => {
    localStorage.removeItem(myToken)

}

// const myName = 'nickname'
// export const setName = (newName) => {
//     localStorage.setItem(myName, JSON.stringify(newName))
// }
//
// // 获取token
// export const getName = () => {
//     return JSON.parse(localStorage.getItem(myName))
// }